TS
<template>
  <a-card style="width: 100%">
    <a-upload-dragger v-model:fileList="fileList" name="file" :multiple="true" @change="handleChange" @drop="handleDrop"
      :customRequest="setfile">
      <p class="ant-upload-drag-icon">
        <!-- <inbox-outlined></inbox-outlined> -->
      </p>
      <p class="ant-upload-text">点击选择文件或将文件拖拽到此处</p>
      <p class="ant-upload-hint">文件将上传到OSS,如未配置请先配置</p>
    </a-upload-dragger>
  </a-card>
  <br />
  <a-card style="width: 100%">
    <!-- 搜索 -->
    <a-form name="customized_form_controls" layout="inline" :model="values" @finish="onFinish"
      style="margin: 30px 0; background: #fff" expandFixed="true">
      <!-- 文件名称输入框 -->
      <a-form-item name="types" label="类型">
        <a-input v-model:value="values.types" placeholder="请输入类型" />
      </a-form-item>
      <a-form-item expandFixed="right">
        <a-button type="primary" html-type="submit">搜索</a-button>
        <a-button @click="() => toset()">重置</a-button>
      </a-form-item>
    </a-form>
  </a-card>
  <br />
  <a-card style="width: 100%">
    <div v-if="posterList.length>0">111</div>
    <div v-else>该页面暂无数据</div>
  </a-card>
</template>

<script setup lang="ts">
import { ref, reactive } from "vue"
import { storeToRefs } from "pinia";
import { useFiles } from "../../store/files"

const ufiles = useFiles();
let {posterList} = storeToRefs(ufiles)
localStorage.removeItem("searchobj")
let fileList = ref([]),
  handleDrop = (e: DragEvent) => {
    console.log(e);
};
ufiles.getposter({page:1,pageSize:12})
const setfile = (v: any) => {
  // console.log(v, "set file")
  let obj = { ...v }.file
}
const handleChange = (info: any) => {
  console.log(info)
  ufiles.uploadfile(info.file.originFileObj)
}
let flag = false;
//定义搜索框的初始数据
const values = reactive({
  types: ""
});
//重置
const toset = () => {
  location.reload()
}

//点击搜索获取表单数据
const onFinish = () => {
  //点击模糊搜索
  console.log(values, "values")
  flag = true
  searchaa()
}
//封装一个模糊搜索的方法
let searchaa = () => {
  let obj = JSON.parse(localStorage.getItem("searchobj") || '{}');
  if (values.types) {
    obj = { ...obj, types: values.types }
  }
  localStorage.setItem("searchobj", JSON.stringify(obj))
}

</script>

<style></style>